<?php

declare(strict_types=1);

namespace ImiApp\ApiServer\Api\Model\Base;

use Imi\Config\Annotation\ConfigValue;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\DDL;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Table;
use ImiApp\ImiServer\AbstractModel as Model;

/**
 * 支付合计订单 基类.
 *
 * @Entity(camel=false, bean=true, incrUpdate=false)
 * @Table(name=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\OrderTotal.name", default="fa_order_total"), usePrefix=false, id={"id"}, dbPoolName=@ConfigValue(name="@app.models.ImiApp\ApiServer\Api\Model\OrderTotal.poolName"))
 * @DDL(sql="CREATE TABLE `fa_order_total` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '支付id',
  `order` varchar(50) DEFAULT NULL COMMENT '订单号',
  `money` decimal(8,2) DEFAULT NULL COMMENT '钱',
  `order_ids` varchar(2550) DEFAULT NULL COMMENT '订单ids',
  `pay_status` enum('1','2','3','4','5','6') DEFAULT '1' COMMENT '支付状态:1=待支付,2=已支付,3=已退款,4=已超时',
  `user_id` int(10) unsigned DEFAULT NULL COMMENT '用户id',
  `time` int(10) DEFAULT NULL COMMENT '创建时间',
  `pay_type` enum('wechat','alipay','wallet','score','shell','mix') DEFAULT NULL COMMENT '支付方式:wechat=微信支付,alipay=支付宝,wallet=钱包支付,score=积分支付,shell=贝壳支付,mix=混合支付',
  `pay_time` int(10) DEFAULT NULL COMMENT '支付时间',
  `pay_money` int(10) DEFAULT NULL COMMENT '实际支付（分）',
  `pay_openid` varchar(32) DEFAULT NULL COMMENT '支付者openid',
  `pay_fee` decimal(10,2) DEFAULT '0.00' COMMENT '实际支付金额',
  `shell_fee` decimal(10,2) DEFAULT '0.00' COMMENT '支付贝壳总数',
  `score_fee` decimal(11,2) DEFAULT '0.00' COMMENT '积分支付数',
  `score_money_fee` decimal(11,2) DEFAULT '0.00' COMMENT '积分服务费金额',
  `pay_update_time` int(10) DEFAULT NULL COMMENT '更新支付时间',
  `gift_money` decimal(10,2) DEFAULT NULL COMMENT '抵扣金额',
  `balance_money` decimal(10,2) DEFAULT NULL COMMENT '余额支付金额',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付合计订单'", decode="")
 *
 * @property int|null $id 支付id
 * @property string|null $order 订单号
 * @property string|float|int|null $money 钱
 * @property string|null $orderIds 订单ids
 * @property string|null $payStatus 支付状态:1=待支付,2=已支付,3=已退款,4=已超时
 * @property int|null $userId 用户id
 * @property int|null $time 创建时间
 * @property string|null $payType 支付方式:wechat=微信支付,alipay=支付宝,wallet=钱包支付,score=积分支付,shell=贝壳支付,mix=混合支付
 * @property int|null $payTime 支付时间
 * @property int|null $payMoney 实际支付（分）
 * @property string|null $payOpenid 支付者openid
 * @property string|float|int|null $payFee 实际支付金额
 * @property string|float|int|null $shellFee 支付贝壳总数
 * @property string|float|int|null $scoreFee 积分支付数
 * @property string|float|int|null $scoreMoneyFee 积分服务费金额
 * @property int|null $payUpdateTime 更新支付时间
 * @property string|float|int|null $giftMoney 抵扣金额
 * @property string|float|int|null $balanceMoney 余额支付金额
 */
abstract class OrderTotalBase extends Model
{
    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEY = 'id';

    /**
     * {@inheritdoc}
     */
    public const PRIMARY_KEYS = ["id"];

    /**
     * 支付id.
     * id
     * @Column(name="id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=true, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $id = NULL;

    /**
     * 获取 id - 支付id.
     *
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * 赋值 id - 支付id.
     * @param int|null $id id
     * @return static
     */
    public function setId($id)
    {
        $this->id = null === $id ? null : (int)$id;
        return $this;
    }

    /**
     * 订单号.
     * order
     * @Column(name="order", type="varchar", length=50, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $order = NULL;

    /**
     * 获取 order - 订单号.
     *
     * @return string|null
     */
    public function getOrder(): ?string
    {
        return $this->order;
    }

    /**
     * 赋值 order - 订单号.
     * @param string|null $order order
     * @return static
     */
    public function setOrder($order)
    {
        $this->order = null === $order ? null : (string)$order;
        return $this;
    }

    /**
     * 钱.
     * money
     * @Column(name="money", type="decimal", length=8, accuracy=2, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $money = NULL;

    /**
     * 获取 money - 钱.
     *
     * @return string|float|int|null
     */
    public function getMoney()
    {
        return $this->money;
    }

    /**
     * 赋值 money - 钱.
     * @param string|float|int|null $money money
     * @return static
     */
    public function setMoney($money)
    {
        $this->money = null === $money ? null : $money;
        return $this;
    }

    /**
     * 订单ids.
     * order_ids
     * @Column(name="order_ids", type="varchar", length=2550, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $orderIds = NULL;

    /**
     * 获取 orderIds - 订单ids.
     *
     * @return string|null
     */
    public function getOrderIds(): ?string
    {
        return $this->orderIds;
    }

    /**
     * 赋值 orderIds - 订单ids.
     * @param string|null $orderIds order_ids
     * @return static
     */
    public function setOrderIds($orderIds)
    {
        $this->orderIds = null === $orderIds ? null : (string)$orderIds;
        return $this;
    }

    /**
     * 支付状态:1=待支付,2=已支付,3=已退款,4=已超时.
     * pay_status
     * @Column(name="pay_status", type="enum", length=0, accuracy=0, nullable=true, default="1", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $payStatus = '1';

    /**
     * 获取 payStatus - 支付状态:1=待支付,2=已支付,3=已退款,4=已超时.
     *
     * @return string|null
     */
    public function getPayStatus(): ?string
    {
        return $this->payStatus;
    }

    /**
     * 赋值 payStatus - 支付状态:1=待支付,2=已支付,3=已退款,4=已超时.
     * @param string|null $payStatus pay_status
     * @return static
     */
    public function setPayStatus($payStatus)
    {
        $this->payStatus = null === $payStatus ? null : (string)$payStatus;
        return $this;
    }

    /**
     * 用户id.
     * user_id
     * @Column(name="user_id", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=true, virtual=false)
     * @var int|null
     */
    protected ?int $userId = NULL;

    /**
     * 获取 userId - 用户id.
     *
     * @return int|null
     */
    public function getUserId(): ?int
    {
        return $this->userId;
    }

    /**
     * 赋值 userId - 用户id.
     * @param int|null $userId user_id
     * @return static
     */
    public function setUserId($userId)
    {
        $this->userId = null === $userId ? null : (int)$userId;
        return $this;
    }

    /**
     * 创建时间.
     * time
     * @Column(name="time", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $time = NULL;

    /**
     * 获取 time - 创建时间.
     *
     * @return int|null
     */
    public function getTime(): ?int
    {
        return $this->time;
    }

    /**
     * 赋值 time - 创建时间.
     * @param int|null $time time
     * @return static
     */
    public function setTime($time)
    {
        $this->time = null === $time ? null : (int)$time;
        return $this;
    }

    /**
     * 支付方式:wechat=微信支付,alipay=支付宝,wallet=钱包支付,score=积分支付,shell=贝壳支付,mix=混合支付.
     * pay_type
     * @Column(name="pay_type", type="enum", length=0, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $payType = NULL;

    /**
     * 获取 payType - 支付方式:wechat=微信支付,alipay=支付宝,wallet=钱包支付,score=积分支付,shell=贝壳支付,mix=混合支付.
     *
     * @return string|null
     */
    public function getPayType(): ?string
    {
        return $this->payType;
    }

    /**
     * 赋值 payType - 支付方式:wechat=微信支付,alipay=支付宝,wallet=钱包支付,score=积分支付,shell=贝壳支付,mix=混合支付.
     * @param string|null $payType pay_type
     * @return static
     */
    public function setPayType($payType)
    {
        $this->payType = null === $payType ? null : (string)$payType;
        return $this;
    }

    /**
     * 支付时间.
     * pay_time
     * @Column(name="pay_time", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $payTime = NULL;

    /**
     * 获取 payTime - 支付时间.
     *
     * @return int|null
     */
    public function getPayTime(): ?int
    {
        return $this->payTime;
    }

    /**
     * 赋值 payTime - 支付时间.
     * @param int|null $payTime pay_time
     * @return static
     */
    public function setPayTime($payTime)
    {
        $this->payTime = null === $payTime ? null : (int)$payTime;
        return $this;
    }

    /**
     * 实际支付（分）.
     * pay_money
     * @Column(name="pay_money", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $payMoney = NULL;

    /**
     * 获取 payMoney - 实际支付（分）.
     *
     * @return int|null
     */
    public function getPayMoney(): ?int
    {
        return $this->payMoney;
    }

    /**
     * 赋值 payMoney - 实际支付（分）.
     * @param int|null $payMoney pay_money
     * @return static
     */
    public function setPayMoney($payMoney)
    {
        $this->payMoney = null === $payMoney ? null : (int)$payMoney;
        return $this;
    }

    /**
     * 支付者openid.
     * pay_openid
     * @Column(name="pay_openid", type="varchar", length=32, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|null
     */
    protected ?string $payOpenid = NULL;

    /**
     * 获取 payOpenid - 支付者openid.
     *
     * @return string|null
     */
    public function getPayOpenid(): ?string
    {
        return $this->payOpenid;
    }

    /**
     * 赋值 payOpenid - 支付者openid.
     * @param string|null $payOpenid pay_openid
     * @return static
     */
    public function setPayOpenid($payOpenid)
    {
        $this->payOpenid = null === $payOpenid ? null : (string)$payOpenid;
        return $this;
    }

    /**
     * 实际支付金额.
     * pay_fee
     * @Column(name="pay_fee", type="decimal", length=10, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $payFee = NULL;

    /**
     * 获取 payFee - 实际支付金额.
     *
     * @return string|float|int|null
     */
    public function getPayFee()
    {
        return $this->payFee;
    }

    /**
     * 赋值 payFee - 实际支付金额.
     * @param string|float|int|null $payFee pay_fee
     * @return static
     */
    public function setPayFee($payFee)
    {
        $this->payFee = null === $payFee ? null : $payFee;
        return $this;
    }

    /**
     * 支付贝壳总数.
     * shell_fee
     * @Column(name="shell_fee", type="decimal", length=10, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $shellFee = NULL;

    /**
     * 获取 shellFee - 支付贝壳总数.
     *
     * @return string|float|int|null
     */
    public function getShellFee()
    {
        return $this->shellFee;
    }

    /**
     * 赋值 shellFee - 支付贝壳总数.
     * @param string|float|int|null $shellFee shell_fee
     * @return static
     */
    public function setShellFee($shellFee)
    {
        $this->shellFee = null === $shellFee ? null : $shellFee;
        return $this;
    }

    /**
     * 积分支付数.
     * score_fee
     * @Column(name="score_fee", type="decimal", length=11, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $scoreFee = NULL;

    /**
     * 获取 scoreFee - 积分支付数.
     *
     * @return string|float|int|null
     */
    public function getScoreFee()
    {
        return $this->scoreFee;
    }

    /**
     * 赋值 scoreFee - 积分支付数.
     * @param string|float|int|null $scoreFee score_fee
     * @return static
     */
    public function setScoreFee($scoreFee)
    {
        $this->scoreFee = null === $scoreFee ? null : $scoreFee;
        return $this;
    }

    /**
     * 积分服务费金额.
     * score_money_fee
     * @Column(name="score_money_fee", type="decimal", length=11, accuracy=2, nullable=true, default="0.00", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $scoreMoneyFee = NULL;

    /**
     * 获取 scoreMoneyFee - 积分服务费金额.
     *
     * @return string|float|int|null
     */
    public function getScoreMoneyFee()
    {
        return $this->scoreMoneyFee;
    }

    /**
     * 赋值 scoreMoneyFee - 积分服务费金额.
     * @param string|float|int|null $scoreMoneyFee score_money_fee
     * @return static
     */
    public function setScoreMoneyFee($scoreMoneyFee)
    {
        $this->scoreMoneyFee = null === $scoreMoneyFee ? null : $scoreMoneyFee;
        return $this;
    }

    /**
     * 更新支付时间.
     * pay_update_time
     * @Column(name="pay_update_time", type="int", length=10, accuracy=0, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var int|null
     */
    protected ?int $payUpdateTime = NULL;

    /**
     * 获取 payUpdateTime - 更新支付时间.
     *
     * @return int|null
     */
    public function getPayUpdateTime(): ?int
    {
        return $this->payUpdateTime;
    }

    /**
     * 赋值 payUpdateTime - 更新支付时间.
     * @param int|null $payUpdateTime pay_update_time
     * @return static
     */
    public function setPayUpdateTime($payUpdateTime)
    {
        $this->payUpdateTime = null === $payUpdateTime ? null : (int)$payUpdateTime;
        return $this;
    }

    /**
     * 抵扣金额.
     * gift_money
     * @Column(name="gift_money", type="decimal", length=10, accuracy=2, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $giftMoney = NULL;

    /**
     * 获取 giftMoney - 抵扣金额.
     *
     * @return string|float|int|null
     */
    public function getGiftMoney()
    {
        return $this->giftMoney;
    }

    /**
     * 赋值 giftMoney - 抵扣金额.
     * @param string|float|int|null $giftMoney gift_money
     * @return static
     */
    public function setGiftMoney($giftMoney)
    {
        $this->giftMoney = null === $giftMoney ? null : $giftMoney;
        return $this;
    }

    /**
     * 余额支付金额.
     * balance_money
     * @Column(name="balance_money", type="decimal", length=10, accuracy=2, nullable=true, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false, unsigned=false, virtual=false)
     * @var string|float|int|null
     */
    protected $balanceMoney = NULL;

    /**
     * 获取 balanceMoney - 余额支付金额.
     *
     * @return string|float|int|null
     */
    public function getBalanceMoney()
    {
        return $this->balanceMoney;
    }

    /**
     * 赋值 balanceMoney - 余额支付金额.
     * @param string|float|int|null $balanceMoney balance_money
     * @return static
     */
    public function setBalanceMoney($balanceMoney)
    {
        $this->balanceMoney = null === $balanceMoney ? null : $balanceMoney;
        return $this;
    }

}
